<table width="100%"><tr><td width="20%">
<a href="../index.html">&lt; index</a><br />
<a href="index.html">&lt; 2. Console emulator</a><br />
<a href="console_init.html">&lt; 2.1 Initializing the console</a>
</td><td width="60%">
<p align="center">
=====================================<br />
2.1.1 Creating the game window<br />
=====================================<br />
</p></td><td width="20%">
</td></tr></table>
<style type="text/css">
.code { color:#444444; background-color:#EEEEEE;}
table.param td { border : 1px solid #000000; }
th { background-color: #44BBFF; color: #FFFFFF }
table.none td { border : 0 }
</style>
<p class="code"><pre>
C++ : static void TCODConsole::initRoot(int w, int h, const char * title, bool fullscreen = false)
C   : void TCOD_console_init_root(int w, int h, const char * title, bool fullscreen)
Py  : console_init_root(w,h,title,fullscreen)
</pre></p>
This will either create a new window in your desktop or switch to full screen. Once this function has been called, you access the root console in C++ with TCODConsole::root, in C by using a NULL console handler.<br />
Note that the C header (libtcod.h) defines the bool type for the C language with :<br />
<p class="code"><pre>
  typedef enum { false, true } bool;
</pre></p>

<table class="param">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td>w, h</td><td>size of the console(in characters). The default characters size in libtcod is 8x8. Here are the resulting resolutions :<br />
<table class="none">
<tr><td>wxh</td><td>console size in pixels</td></tr>
<tr><td>80x50</td><td>640x400</td></tr>
<tr><td>80x60</td><td>640x480</td></tr>
<tr><td>100x75</td><td>800x600</td></tr>
<tr><td>128x96</td><td>1024x768</td></tr>
<tr><td>144x108</td><td>1152x864</td></tr>
<tr><td>160x128</td><td>1280x1024</td></tr>
</table></td></tr>
<tr><td>title</td><td>title of the window. It's not visible when you are in fullscreen.</td></tr>
<tr><td>fullscreen</td><td>wether you start in windowed or fullscreen mode.</td></tr>
</table>
Example :<br />
<p class="code"><pre>
C++ : TCODConsole::initRoot(80,50,"The Chronicles Of Doryen v0.1",false);
C   : TCOD_console_init_root(80,50,"The Chronicles Of Doryen v0.1",false);
Py  : libtcod.console_init_root(80,50,"The Chronicles Of Doryen v0.1",False)
</pre></p>
